package com.miplus.ccrm.sms;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class SmsR<T> implements Serializable  {
    private static final long serialVersionUID = 1L;

    /**
     * 0=Success，其它失败码
     */
    private Integer code;

    /**
     * 失败原因
     */
    private String message;

    /**
     * 成功的关联ID
     */
    private String refID;

    public static <T> SmsR<T> Success(String r)
    {
        SmsR<T> result=new SmsR<>();
        result.setCode(0);
        result.setMessage("SUCCESS");
        result.setRefID(r);
        return result;
    }

    public static <T> SmsR<T> Error(Integer Code,String Message)
    {
        SmsR<T> result=new SmsR<>();
        result.setCode(Code);
        result.setMessage(Message);
        result.setRefID("");
        return result;
    }
}
